package com.workerhelping.feignClients;

import com.workerhelping.dto.PhoneNumDTO;
import com.workerhelping.result.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient("REDIS")
public interface RedisFeignClient {
    /**
     * 调用redis服务存入验证码
     * @param key
     * @param value
     * @return
     */
    @GetMapping("/sendMessage")
    Result<Object> sendMessage(@RequestParam("key") String key,
                               @RequestParam("value") String value);

    /**
     * 调用redis服务获取验证码
     * @param phoneNumDTO
     * @return
     */
    @PostMapping("/getVerificationCode")
    Result<String> getVerificationCode(@RequestBody PhoneNumDTO phoneNumDTO);
}
